<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core"  prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>Login</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="" />
	<meta name="keywords" content="" />
	<meta name="author" content="" />
	<!-- Facebook and Twitter integration -->
	<meta property="og:title" content=""/>
	<meta property="og:image" content=""/>
	<meta property="og:url" content=""/>
	<meta property="og:site_name" content=""/>
	<meta property="og:description" content=""/>
	<meta name="twitter:title" content="" />
	<meta name="twitter:image" content="" />
	<meta name="twitter:url" content="" />
	<meta name="twitter:card" content="" />

	<%--<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,700" rel="stylesheet">--%>

	<!-- Animate.css -->
	<link rel="stylesheet" href="../jsp/css/animate1.css" />
	<!-- Icomoon Icon Fonts-->
	<link rel="stylesheet" href="<%=basePath %>/css/icomoon.css"/>
	<!-- Themify Icons-->
	<link rel="stylesheet" href="<%=basePath %>/css/themify-icons.css"/>
	<!-- Bootstrap  -->
	<link rel="stylesheet" href="<%=basePath %>/css/bootstrap.css"/>

	<!-- Magnific Popup -->
	<link rel="stylesheet" href="<%=basePath %>/css/magnific-popup.css"/>

	<!-- Owl Carousel  -->
	<link rel="stylesheet" href="<%=basePath %>/css/owl.carousel.min.css"/>
	<link rel="stylesheet" href="<%=basePath %>/css/owl.theme.default.min.css"/>

	<!-- Theme style  -->
	<link rel="stylesheet" href=<%=basePath %>/css/style.css"/>

	<!-- Modernizr JS -->
	<script src="<%=basePath %>/js/modernizr-2.6.2.min.js"></script>
	<!-- FOR IE9 below -->
	<!--[if lt IE 9]>
	<script src="<%=basePath %>/js/respond.min.js"></script>

	<![endif]-->

</head>
	<body>

	<div class="gtco-loader"></div>

	<div id="page">


	<div class="page-inner">
	<nav class="gtco-nav" role="navigation">
		<div class="gtco-container">
			
			<div class="row">
				<div class="col-sm-4 col-xs-12">
					<div id="gtco-logo"><a href="Login.jsp">每日乐享 <em>.</em></a></div>
				</div>
				<div class="col-xs-8 text-right menu-1">
					<ul>
						<li><a href="features.html">NBA</a></li>
						<li><a href="tour.html">读书</a></li>
						<li class="has-dropdown">
							<a href="#">财经</a>
							<ul class="dropdown">
								<li><a href="#">Web Design</a></li>
								<li><a href="#">eCommerce</a></li>
								<li><a href="#">Branding</a></li>
								<li><a href="#">API</a></li>
							</ul>
						</li>
						<li><a href="pricing.html">娱乐</a></li>
						<li><a href="contact.html">军事</a></li>
						<li class="btn-cta"><a href="#"><span>时事</span></a></li>
					</ul>
				</div>
			</div>
			
		</div>
	</nav>
	
	<header id="gtco-header" class="gtco-cover" role="banner" style="background-image: url(images/img_4.jpg)">
		<div class="overlay"></div>
		<div class="gtco-container">
			<div class="row">
				<div class="col-md-12 col-md-offset-0 text-left">
					<div class="row row-mt-15em">
						<div class="col-md-7 mt-text animate-box" data-animate-effect="fadeInUp">
							<!--<span class="intro-text-small">欢迎来到每日乐享</span>-->
							<h1>欢迎来到每日乐享.</h1>
						</div>
						<div class="col-md-4 col-md-push-1 animate-box" data-animate-effect="fadeInRight">
							<div class="form-wrap">
								<div class="tab">
									<ul class="tab-menu">
										<li class="active gtco-first"><a href="#" data-tab="signup">注册</a></li>
										<li class="gtco-second"><a href="#" data-tab="login">登录</a></li>
									</ul>
									<div class="tab-content">
										<div class="tab-content-inner active" data-content="signup">
											<form action="${pageContext.request.contextPath }/admin/register">
												<div class="row form-group">
													<div class="col-md-12">
														<label for="username">用户名</label>
														<input type="text" class="form-control" id="username" name="loginName"><span id="spanUname1"></span>
													</div>
												</div>
												<div class="row form-group">
													<div class="col-md-12">
														<label for="password">密码</label>
														<input type="password" class="form-control" id="password" name="loginPwd"><span id="spanUname2"></span>
													</div>
												</div>
												<div class="row form-group">
													<div class="col-md-12">
														<label for="password2">重复密码</label>
														<input type="password" class="form-control" id="password2" name="password2"><span id="spanUname3"></span>
													</div>
												</div>
												<div class="row form-group">
													<div class="col-md-12">
														<label for="username">真实姓名</label>
														<input type="text" class="form-control"  name="username"><span id="spanUname4"></span>
													</div>
												</div>
												<div class="row form-group">
													<div class="col-md-12">
														<label for="username">电子邮箱</label>
														<input type="text" class="form-control"  name="email"><span id="spanUname5"></span>
													</div>
												</div>

												<div class="row form-group">
													<div class="col-md-12">
														<input type="submit" name="RegistrationSubmission" class="btn btn-primary" value="Sign up ">
													</div>
												</div>
											</form>	
										</div>
										<div class="tab-content-inner" data-content="login">
											<form action="#">
												<div class="row form-group">
													<div class="col-md-12">
														<label for="username">用户名或电子邮箱</label>
														<input type="text" class="form-control">
													</div>
												</div>
												<div class="row form-group">
													<div class="col-md-12">
														<label for="password">密码</label>
														<input type="password" class="form-control">
													</div>
												</div>
												<div class="row form-group">
													<div class="col-md-12">
														<input type="submit" class="btn btn-primary" value="Login">
													</div>
												</div>
											</form>	
										</div>

									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</header>





	<footer id="gtco-footer" role="contentinfo">
		<div class="gtco-container">
			<div class="row row-p	b-md">

				<div class="col-md-4">
					<div class="gtco-widget">
						<h3>关于 <span class="footer-logo">每日乐享</span>.<span></span></h3>
						<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Tempore eos molestias quod sint ipsum possimus temporibus officia iste perspiciatis consectetur in fugiat repudiandae cum. Totam cupiditate nostrum ut neque ab?</p>
					</div>
				</div>

				<div class="col-md-4 col-md-push-1">
					<div class="gtco-widget">
						<h3>链接</h3>
						<ul class="gtco-footer-links">
							<li><a href="#">知识库</a></li>
							<li><a href="#">职业生涯</a></li>
							<li><a href="#">服务条款</a></li>
							<li><a href="#">隐私政策</a></li>
						</ul>
					</div>
				</div>

				<div class="col-md-4">
					<div class="gtco-widget">
						<h3>进入 触觉</h3>
						<ul class="gtco-quick-contact">
							<li><a href="#"><i class="icon-phone"></i> +1 234 567 890</a></li>
							<li><a href="#"><i class="icon-mail2"></i> info@</a></li>
							<li><a href="#"><i class="icon-chat"></i> 现场聊天</a></li>
						</ul>
					</div>
				</div>

			</div>

			<div class="row copyright">
				<div class="col-md-12">
					<p class="pull-left">
						<small class="block">Copyright &copy; 2016.Company name All rights reserved.</small>
					</p>
					<p class="pull-right">
						<ul class="gtco-social-icons pull-right">
							<li><a href="#"><i class="icon-twitter"></i></a></li>
							<li><a href="#"><i class="icon-facebook"></i></a></li>
							<li><a href="#"><i class="icon-linkedin"></i></a></li>
							<li><a href="#"><i class="icon-dribbble"></i></a></li>
						</ul>
					</p>
				</div>
			</div>

		</div>
	</footer>
	</div>

	</div>

	<div class="gototop js-top">
		<a href="#" class="js-gotop"><i class="icon-arrow-up"></i></a>
	</div>
	<script type="text/javascript" src="<%=basePath %>/js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript">
        $(document).ready(function(){
            $("[name=loginName]").blur(function(){
                var name = $(this).val();
                if(name==""){
                    $("#spanName").html("用户名不能为空");
                }else{
                    $.ajax({
                        url:"${pageContext.request.contextPath }/admin/RegisterName",
                        type:"get",
                        data:"name="+name,
                        dataType:"text",
                        async:false,
                        success:function(result){
                            $("#spanName").html(result);
                        }
                    });
                }
            });
            $("[name=email]").blur(function(){
                var name = $(this).val();
                if(name==""){
                    $("#spanName").html("邮箱不能为空");
                }else{
                    $("#spanName").html("");
                }
            });
            $("[name=loginPwd]").blur(function(){
                var name = $(this).val();
                if(name==""){
                    $("#spanPwd").html("密码不能为空");
                }else{
                    $("#spanPwd").html("");
                }
            });
            $("[name=password2]").blur(function(){
                var name = $(this).val();
                if(name==""){
                    $("#spanNames").html("请确认密码");
                }else{
                    $("#spanNames").html("");
                }
            });
            $("[name=username]").blur(function(){
                var name = $(this).val();
                if(name==""){
                    $("#spanUname").html("真实姓名不能为空");
                }else{
                    $("#spanUname").html("");
                }
            });
            $("[name=RegistrationSubmission]").click(function(){
                var name = $("[name=loginName]").val();
                var uPattern = /^[a-zA-Z0-9_-]{4,16}$/;
                if(name==""){
                    $("#spanName").html("用户名不能为空");
                    return false;
                }else if(!uPattern.test(name)){
                    $("#spanName").html("4到16位（字母，数字，下划线，减号）");
                    return false;
				}else {
                    $("#spanName").html("");
                }
                var name1 = $("[name=loginPwd]").val();
                /*密码强度正则，最少6位，包括至少1个大写字母，1个小写字母，1个数字，1个特殊字符*/
                var pPattern = /^.*(?=.{6,})(?=.*\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[!@#$%^&*? ]).*$/;
                if(name1==""){
                    $("#spanPwd").html("密码不能为空");
                    return false;
                }else if(!pPattern.test(name1)){
                    $("#spanPwd").html("最少6位，包括至少1个大写字母，1个小写字母，1个数字，1个特殊字符");
				}else{
                    $("#spanPwd").html("");
                }
                var name = $("[name=password2]").val();
                if(name==""){
                    $("#spanNames").html("请确认密码");
                    return false;
                }else if(name!=name1){
                    $("#spanNames").html("密码不一致");
                    return false;
                }{
                    $("#spanNames").html("");
                }
                var name = $("[name=username]").val();
                if(name==""){
                    $("#spanUname").html("真实姓名不能为空");
                    return false;
                }else{
                    $("#spanUname").html("");
                }
                $("[name=email]").blur(function(){
                    var name = $(this).val();
                    var myreg = /^([\.a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/;
                    if(name==""){
                        $("#spanName").html("邮箱不能为空");
                        return false;
                    }else if(!myreg.test(name)){
                        $("#spanName").html("请输入有效的邮箱地址！");
                        return false;
                    }else{
                        $("#spanName").html("");
                    }
                });
            });
        });
	</script>
	<!-- jQuery -->
	<script src="<%=basePath %>/js/jquery.min.js"></script>
	<!-- jQuery Easing -->
	<script src="<%=basePath %>/js/jquery.easing.1.3.js"></script>
	<!-- Bootstrap -->
	<script src="<%=basePath %>/js/bootstrap.min.js"></script>
	<!-- Waypoints -->
	<script src="<%=basePath %>/js/jquery.waypoints.min.js"></script>
	<!-- Carousel -->
	<script src=<%=basePath %>/js/owl.carousel.min.js"></script>
	<!-- countTo -->
	<script src="<%=basePath %>/js/jquery.countTo.js"></script>
	<!-- Magnific Popup -->
	<script src="<%=basePath %>/js/jquery.magnific-popup.min.js"></script>
	<script src="<%=basePath %>/js/magnific-popup-options.js"></script>
	<!-- Main -->
	<script src="<%=basePath %>/js/main.js"></script>

	</body>
</html>

